﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using PJ.Data;

namespace PJ.Data.WCF
{
    public class ItemProviderClient<S, D> : EntityProviderClient<S, D>, IItemWCFProvider<D>
        where D : BaseItemData, new()
        where S : class, IItemWCFProvider<D>
    {
        public ItemProviderClient() {
        }
        
        public ItemProviderClient(string endpointConfigurationName) : 
                base(endpointConfigurationName) {
        }
        
        public ItemProviderClient(string endpointConfigurationName, string remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }
        
        public ItemProviderClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(endpointConfigurationName, remoteAddress) {
        }

        public ItemProviderClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
                base(binding, remoteAddress) {
        }

        public D GetByName(string sessionId, string name, int mode)
        {
            if (name == null || name == "")
                throw new ArgumentNullException("name");
            return base.Channel.GetByName(sessionId, name, mode);
        }
        public D GetByAlias(string sessionId, string aliasName, int mode)
        {
            if (aliasName == null || aliasName == "")
                throw new ArgumentNullException("aliasName");
            return base.Channel.GetByAlias(sessionId, aliasName, mode);
        }
        public string[] Search(string sessionId, string searchTxt, int mode)
        {
            if (searchTxt == null || searchTxt == "")
                throw new ArgumentNullException("searchTxt");
            return base.Channel.Search(sessionId, searchTxt, mode);
        }
        #region Interface override
        #endregion


    }
}
